package cate.game.role.pvp.teampvp.msg;

import cate.common.util.GameResult;
import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdBTeamPvp;
import cate.game.pvp.teampvp.dto.TeamPvpMatchData;
import easy.java.dev.note.NoteField;

import java.util.List;

@ClientMsg(title = "布阵阶段改变对阵位置的请求")
public class TeamPvpChangePositionReq implements MsgInput {
    @NoteField("按顺序的uids")
    public List<String> uids;

    @Override
    public void execute(GameBody game, ClientContext cc) {
        GameResult<TeamPvpMatchData> r = game.pvp.teamPvp.changePosition(cc.getRole(), uids);
        if (!r.ok()) {
            game.notice.message(cc.getRole(), r);
            return;
        }
        cc.sendNow(new TeamPvpMatchResp(r.data));
    }

    @Override
    public MsgConfig conf() {
        return MsgIdBTeamPvp.CHANGE_POSITION_REQ;
    }
}
